<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>entries(),keys(),values()</title>
  </head>
  <body>
    <p>
      entries(),keys(),values() 遍历数组返回一个遍历器对象，可用for...of循环
    </p>
    <pre>
        for(let index of ['a','b'].keys()){
            console.log(index)    // 0  1
        }
           for(let value of ['a','b'].values()){
            console.log(value)    // 'a'  'b'
        }
               for(let entries of ['a','b'].entries()){
            console.log(entries)    // [0,'a']   [1,'b']
        }
      </pre
    >
  </body>
</html>
<script>
  for (let index of ["a", "b"].keys()) {
    console.log(index); // 0  1
  }
  for (let value of ["a", "b"].values()) {
    console.log(value); // 'a'  'b'
  }
  for (let entries of ["a", "b"].entries()) {
    console.log(entries); // [0,'a']   [1,'b']
  }
</script>
